<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreatePayRecordsTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('pay_records', function (Blueprint $table) {
            $table->increments('id');
            $table->decimal('amount', 10, 2)->default(0);
            $table->string('channel', 16);
            $table->string('out_trade_no', 64);
            $table->text('extra_param')->nullable();
            $table->string('trade_state', 16);
            $table->string('transaction_id', 64)->nullable();
            $table->string('payer_openid', 64)->nullable();
            $table->integer('payer_id')->nullable();
            $table->text('notify_data')->nullable();
            $table->timestamp('notify_at')->nullable();
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('pay_records');
    }
}
